/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pigx.shop.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pigx.shop.api.dto.GoodsSpuDTO;
import com.pig4cloud.pigx.shop.api.entity.GoodsSku;
import com.pig4cloud.pigx.shop.api.entity.GoodsSpu;
import com.pig4cloud.pigx.shop.api.vo.GoodsSpuVO;

import java.util.List;

/**
 * 商品表
 *
 * @author pig code generator
 * @date 2023-10-30 14:09:10
 */
public interface GoodsSpuService extends IService<GoodsSpu> {

	/**
	 * 分页查询商品数据
	 * @param page
	 * @param goodsSpu
	 * @return
	 */
	IPage<GoodsSpuVO> pageList(Page page, GoodsSpu goodsSpu);

	/**
	 * 获取所有商品列表
	 * @param goodsSpuDTO
	 * @return
	 */
	List<GoodsSpuVO> getList(GoodsSpuDTO goodsSpuDTO);

	/**
	 * 添加商品
	 * @param goodsSpuVO
	 * @return
	 */
	boolean add(GoodsSpuVO goodsSpuVO, boolean isAddSpu);

	/**
	 * 获取商品详情
	 * @param id
	 * @return
	 */
	GoodsSpuVO getGoodsById(Long id, Long skuId);

	/**
	 * 获取简版商品sku信息
	 * @param id
	 * @param skuId
	 * @return
	 */
	GoodsSpuVO getSimpleSkuById(Long id, Long skuId);

	/**
	 * 删除商品
	 * @param id
	 * @return
	 */
	boolean deleteById(Long id, boolean isDelSpu);

	/**
	 * 更新数据
	 * @param goodsSpuVO
	 * @return
	 */
	boolean update(GoodsSpuVO goodsSpuVO);

	/**
	 * 修改sku
	 * @param goodsSpuVO
	 * @return
	 */
	boolean updateSkuById(GoodsSpuVO goodsSpuVO);

	/**
	 * 修改sku状态
	 * @param goodsSku
	 * @return
	 */
	boolean updateSkuStatusById(GoodsSku goodsSku);

	/**
	 * 获取商品详情
	 * @param goodsSpuDTO
	 * @return
	 */
	GoodsSpuVO getGoodsSpuDetail(GoodsSpuDTO goodsSpuDTO);

}
